package com.ai.module.chat.common.domain;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * @author: MrHe
 * @create: 2023-09-02 10:14
 * @description:
 **/
@Data
public class BaseEntity {


    @TableId(type = IdType.AUTO, value = "id")
    public Integer id;

    @TableField(value = "uuid", fill = FieldFill.INSERT)
    public String uuid;


    @TableField(value = "created_time", fill = FieldFill.INSERT)
//    @JsonSerialize(using = LocalDateTimeSerializer.class)
//    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    public LocalDateTime createdTime = LocalDateTime.now();


    @TableField(value = "updated_time", fill = FieldFill.INSERT_UPDATE)
//    @JsonSerialize(using = LocalDateTimeSerializer.class)
//    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    public LocalDateTime updatedTime = LocalDateTime.now();

}
